<meta charset="UTF-8">
<table
	     class="easyui-datagrid"   
	     id="datagrid"  
         title="项目资料发送"  
         url="${base}/getProEmail/list"
         toolbar="#searchtool,#toolbar" 
         pagination="true"
         rownumbers="true" 
         fitColumns="true"
         data-options="fit:false,border:false,pageSize:20,pageList:[5,10,15,20]" >  
    <thead>  
        <tr>
            <th field="id" width="5%" checkbox="true"></th>  
            <th field="createTimes" width="15%">创建时间</th>  
            <th field="updateTimes" width="15%">更新时间</th>
            <th field="updateName" width="10%">更新人</th>
            <th field="email" width="15%">邮箱地址</th>
            <th field="projectId" width="10%">项目编号</th> 
            <th field="projectName" width="25%">项目名称</th>
            <!-- <th field="status" width="10%">状态</th>  -->
            <th field="statusName" width="6%">发送状态</th>     
        </tr>  
    </thead>  
</table> 
<form id="fm">
 <div id="searchtool" style="padding:5px">
 	  <span>开始时间:</span><input name="startTime" class="easyui-datebox" data-options="formatter:myformatter,parser:myparser" style="width:200px" >  
      <span>结束时间:</span><input name="endTime" class="easyui-datebox"  data-options="formatter:myformatter,parser:myparser" style="width:200px" >  
      <span>关键字:</span><input type="text" style="width: 230px" id="condition" placeholder="邮箱/项目编号/项目名称/修改人名称" value="" size=20 />  
      <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" onclick="javascript:getQueryData();">搜索</a>  
<div> 
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-remove" plain="true" onclick="destroyUser()">修改发送状态</a>
</form> 
<script type="text/javascript">
function getQueryData(){
	var searchName = $("#condition").val();
	var beginTimes = $("input[name='startTime']").val() ;
	var endTimes = $("input[name='endTime']").val();
		$('#datagrid').datagrid('load',{ 
			beginTimes:beginTimes,
			endTimes:endTimes,
			searchName:searchName
		}); 
	
	}
	
	
function destroyUser(){
    var rows = $('#datagrid').datagrid('getSelections');
    var ids = [];
    if (rows.length > 0){
    	for(var i=0; i<rows.length; i++){
    		ids.push(rows[i].id);
    	}
        $.messager.confirm('Confirm','是否修改状态为已发送?',function(r){
            if (r){
            	url = 'getProEmail/updateStatus.do?ids='+ids.join(",");
            	 $.post(url,function(result){
            		 $.messager.alert('提示',"修改成功",'info'); 
                       $('#datagrid').datagrid('reload');   
                 });
            }
        });
    }
}
/*
onClickRow: function(rowIndex, rowData){
    //加载完毕后获取所有的checkbox遍历
    $("input[type='checkbox']").each(function(index, el){
        //如果当前的复选框不可选，则不让其选中
        if (el.disabled == true) {
            POSStockHeadTable.datagrid('unselectRow', index - 1);
        }
    })
} */
</script>

